/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.facade;

/**
 * @author caicongyang1
 * @version id: Facade, v 0.1 17/5/14 下午8:31 caicongyang1 Exp $$
 */
public class Facade {
    private SubSystemA systemA;
    private SubSystemB systemB;
    private SubSystemC systemC;
    private SubSystemD systemD;

    public Facade() {
        if (null == systemA) {
            systemA = new SubSystemA();

        }
        if (null == systemB) {
            systemB = new SubSystemB();
        }
        if (null == systemC) {
            systemC = new SubSystemC();
        }
        if (null == systemD) {
            systemD = new SubSystemD();
        }
    }

    public void groupA() {
        systemA.methodA();
        systemB.methodB();
    }

    public void groupB() {
        systemC.methodC();
        systemD.methodD();
    }

}
